package com.example.jdshopdeail.adapter;


import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import com.example.jdshopdeail.R;

import java.util.List;

/**
 * 作者： njb
 * 时间： 2018/5/22 0022-下午 3:56
 * 描述：
 * 来源：
 */
public class ViewPagerAdapter extends FragmentPagerAdapter {
    private String tabTitles[] = new String[]{(R.string.body_detail) + "", R.string.product_case + "", R.string.evaluation + ""};
    private List<Fragment> list;

    public ViewPagerAdapter(FragmentManager fm, List<Fragment> list) {
        super(fm);
        this.list = list;
    }

    @Override
    public Fragment getItem(int position) {

        return list.get(position);
    }


    @Override
    public int getCount() {
        return list != null ? list.size() : 0;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return tabTitles[position];
    }
}
